package com.nova.edc.model.system;

import java.util.Date;

import com.nova.frame.annotation.Id;
import com.nova.frame.annotation.Table;
import com.nova.frame.annotation.Transient;
import com.nova.module.filter.annotation.FilterCondition;

@Table("t_gatewayimage")
public class GatewayImage {
	@Id
	private Integer id;
	@FilterCondition
	private String gatewayid;
	private String sensorid;
	private String channelid;
	private String imageurl;
	private String memo;
	@FilterCondition
	private Integer scrapped;
	private Date modifystamp;
	@FilterCondition
	private String addby;
	private Date adddate;
	private String modifyby;
	private Date modifydate;
	@SuppressWarnings("unused")
	@Transient
	private String imgName;
	@SuppressWarnings("unused")
	@Transient
	private String imgNameWithSuffix;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getGatewayid() {
		return gatewayid;
	}

	public void setGatewayid(String gatewayid) {
		this.gatewayid = gatewayid;
	}

	public String getSensorid() {
		return sensorid;
	}

	public void setSensorid(String sensorid) {
		this.sensorid = sensorid;
	}

	public String getChannelid() {
		return channelid;
	}

	public void setChannelid(String channelid) {
		this.channelid = channelid;
	}

	public String getImageurl() {
		return imageurl;
	}

	public void setImageurl(String imageurl) {
		this.imageurl = imageurl;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public Integer getScrapped() {
		return scrapped;
	}

	public void setScrapped(Integer scrapped) {
		this.scrapped = scrapped;
	}

	public Date getModifystamp() {
		return modifystamp;
	}

	public void setModifystamp(Date modifystamp) {
		this.modifystamp = modifystamp;
	}

	public String getAddby() {
		return addby;
	}

	public void setAddby(String addby) {
		this.addby = addby;
	}

	public Date getAdddate() {
		return adddate;
	}

	public void setAdddate(Date adddate) {
		this.adddate = adddate;
	}

	public String getModifyby() {
		return modifyby;
	}

	public void setModifyby(String modifyby) {
		this.modifyby = modifyby;
	}

	public Date getModifydate() {
		return modifydate;
	}

	public void setModifydate(Date modifydate) {
		this.modifydate = modifydate;
	}

	public String getImgName() {
		try {
			return imageurl.substring(imageurl.lastIndexOf("/") + 1,
					imageurl.lastIndexOf("."));
		} catch (Exception e) {
			return "";
		}
	}

	public void setImgName(String imgName) {
		this.imgName = imgName;
	}

	public String getImgNameWithSuffix() {
		try {
			return imageurl.substring(imageurl.lastIndexOf("/") + 1);
		} catch (Exception e) {
			return "";
		}
	}

	public void setImgNameWithSuffix(String imgNameWithSuffix) {
		this.imgNameWithSuffix = imgNameWithSuffix;
	}

}
